<template>
  <div class="dashboard-container">
    <div class="dashboard-text">Dashboard: {{ name }}</div>
    <el-button type="primary" @click="gettableData()">主要按钮</el-button>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  data() {
    return {
      req: {
        "start": "2024/09/30 14:00:00",
        "end": "2024/10/01 14:00:00"
      }
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    gettableData() {
      this.$axios({
        method: 'post',
        url: '/api/data/dataSync',
        data: this.req,
      })
        .then((tabledata) => {
          console.log("tabledata",tabledata)
          // this.$message(res.data);
        })
        .catch(res => {
          this.$message(res.response.data);
        });
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
